home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gnome-pilot.idb / usr / freeware / share / idl / gnome-pilot.idl.z / gnome-pilot.idl
Text File  |  2001-10-09  |  7KB  |  254 lines

  1. /* -*- Mode: IDL; indent-tabs-mode: t; tab-width: 8 -*- *//* 
  2.  * Copyright (C) 1998-2000 Free Software Foundation
  3.  *
  4.  * This program is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU General Public License as
  6.  * published by the Free Software Foundation; either version 2 of the
  7.  * License, or (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public
  15.  * License along with this program; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  *
  19.  * Authors: Eskil Heyn Olsen  <eskil@eazel.com>
  20.  */
  21.  
  22.  
  23. /*
  24.    IDL for gpilotd communcation
  25.    $Id: gnome-pilot.idl,v 1.25 2000/08/07 01:02:18 eskil Exp $
  26.    $Author: eskil $
  27. */
  28.  
  29. module GNOME {    
  30.     module Pilot {
  31.  
  32.         /* typedefinitions and enums */
  33.         typedef sequence<string> StringSequence;
  34.         typedef sequence<long> LongSequence;
  35.  
  36.         /* exception thrown when requested pilot doesn't exist */
  37.         exception UnknownPilot {
  38.             string pilotId;
  39.         };
  40.     
  41.         /* exception thrown when user doesn't exist */
  42.         exception UnknownUser {
  43.             string user;
  44.         };
  45.     
  46.         /* exception thrown when conduit doesn't exist */
  47.         exception UnknownConduit {
  48.             string conduit;
  49.         };
  50.     
  51.         /* exception thrown when requested file or directory doesn't exist */
  52.         exception MissingFile {
  53.         };
  54.     
  55.         /* exception thrown when no access to file/directory/pilot is give */
  56.         exception NoAccess {
  57.         };
  58.  
  59.         /* exception thrown when no monitors are on, but client called notify */
  60.         exception NoMonitors {
  61.         };
  62.       
  63.         /* exception throw when the given request handle doesn't exist */
  64.         exception NoSuchHandle {
  65.         };
  66.     
  67.         /* exception thrown when the pilot is already syncing */
  68.         exception PilotBusy {
  69.         };
  70.      
  71.         /* execption thrown when the cradle is already in use */
  72.         exception CradleBusy {
  73.         };
  74.  
  75.         enum ConfigErrorType {
  76.             DEVICE_MISSING,
  77.             DEVICE_CANNOT_BE_OPENED
  78.         };
  79.  
  80.         /* exception thrown when the daemon's config prevents it for doing anything */
  81.         exception ConfigError {
  82.             ConfigErrorType errorType;
  83.             string message;
  84.         };
  85.     
  86.         enum Survival {
  87.             IMMEDIATE,
  88.             PERSISTENT
  89.         };
  90.     
  91.         enum EventType {
  92.             NOTIFY_CONNECT,
  93.             NOTIFY_DISCONNECT,
  94.             NOTIFY_BACKUP,
  95.             NOTIFY_CONDUIT,
  96.             NOTIFY_REQUEST_COMPLETION,
  97.             NOTIFY_REQUEST_TIMEOUT,
  98.             NOTIFY_USERINFO_REQUESTED,
  99.             NOTIFY_SYSINFO_REQUESTED,
  100.             NOTIFY_USERINFO_SENT
  101.         };
  102.  
  103.         enum ConduitOperation {
  104.             SYNCHRONIZE,
  105.             CONDUIT_DEFAULT,
  106.             COPY_FROM_PILOT,
  107.             COPY_TO_PILOT,
  108.             MERGE_FROM_PILOT,
  109.             MERGE_TO_PILOT
  110.         };
  111.     
  112.         struct PilotUser {
  113.             unsigned long userID;
  114.             string username;
  115.         };
  116.     
  117.         struct SysInfo {
  118.             /* memory is KB's */
  119.             long romSize;
  120.             long ramSize;
  121.             long ramFree;
  122.             string name;
  123.             string manufacturer;
  124.         };
  125.     
  126.         interface Client {
  127.             attribute string client_id;
  128.             oneway void connect(in string pilot_id, 
  129.                         in PilotUser userinfo);
  130.             oneway void disconnect(in string pilot_id);
  131.             oneway void request_completed(in string pilot_id,
  132.                               in unsigned long request_id);
  133.             /*oneway void backup(in string pilot_id,in string filename); */
  134.             /*oneway void request_timeout(in string pilot_id,
  135.               in unsigned long request_id);*/
  136.             oneway void userinfo_requested(in string device,
  137.                                in PilotUser user);
  138.             oneway void sysinfo_requested(in string pilot_id,
  139.                               in SysInfo sysinfo);
  140.  
  141.             /* progress bar additions */
  142.             oneway void conduit_start(in string pilot_id,
  143.                           in string conduit, 
  144.                           in string database);
  145.             oneway void conduit_progress(in string pilot_id,
  146.                              in string conduit,
  147.                              in unsigned long current, 
  148.                              in unsigned long total);
  149.             oneway void conduit_end(in string pilot_id,
  150.                         in string conduit);
  151.  
  152.             /* call that lets a conduit give the user some
  153.                            sort of info or error message */
  154.             oneway void conduit_message(in string pilot_id, 
  155.                             in string conduit, 
  156.                             in string message);
  157.             oneway void conduit_error(in string pilot_id, 
  158.                           in string conduit, 
  159.                           in string message);
  160.  
  161.         };
  162.     
  163.         interface Daemon {
  164.             /* adm calls */
  165.             void pause(in boolean on_off)
  166.                 raises (NoAccess);
  167.  
  168.             /* request operations */
  169.             unsigned long request_install(in Client cb,
  170.                               in string pilot_id,
  171.                               in string file_name,
  172.                               in string description,
  173.                               in Survival survival,
  174.                               in unsigned long timeout)
  175.                 raises(UnknownPilot,MissingFile,NoAccess);
  176.     
  177.             unsigned long request_restore(in Client cb,
  178.                               in string pilot_id,
  179.                               in string directory,
  180.                               in Survival survival,
  181.                               in unsigned long timeout)
  182.                 raises(UnknownPilot,MissingFile,NoAccess);
  183.  
  184.             unsigned long request_conduit(in Client cb,
  185.                               in string pilot_id,
  186.                               in string conduit_name,
  187.                               in ConduitOperation operation,
  188.                               in Survival survival,
  189.                               in unsigned long timeout)
  190.                 raises(UnknownPilot,UnknownConduit,NoAccess);
  191.         
  192.             unsigned long remove_request(in unsigned long handle)
  193.                 raises(NoSuchHandle);
  194.             unsigned long get_system_info(in Client cb,
  195.                               in string pilot_id,
  196.                               in Survival survival,
  197.                               in unsigned long timeout);
  198.  
  199.             /* information operations */    
  200.     
  201.             StringSequence get_users();
  202.             StringSequence get_cradles();
  203.             StringSequence get_pilots();
  204.  
  205.     
  206.             LongSequence   get_pilot_ids();
  207.  
  208.             StringSequence get_pilots_by_user_name(in string user);
  209.             StringSequence get_pilots_by_user_login(in string uid);
  210.             string         get_user_name_by_pilot_name(in string pilot_id);
  211.             string         get_user_login_by_pilot_name(in string pilot_id);
  212.  
  213.             string         get_pilot_base_dir(in string pilot_id);
  214.             long           get_pilot_id_from_name(in string pilot_id);
  215.             string         get_pilot_name_from_id(in long pilot_id);
  216.             StringSequence get_databases_from_cache(in string pilot_id);
  217.  
  218.             /* admin operations */
  219.             unsigned long get_user_info(in Client cb,
  220.                             in string cradle,
  221.                             in Survival survival,
  222.                             in unsigned long timeout);
  223.             unsigned long set_user_info(in Client cb,
  224.                             in PilotUser user,
  225.                             in string cradle,
  226.                             in boolean continue_sync,
  227.                             in Survival survival,
  228.                             in unsigned long timeout);
  229.             /*
  230.               unsigned long set_user_info_if_not_set(in PilotUser user,
  231.               in Client cb,
  232.               in string cradle,
  233.               in Survival survival,
  234.               in unsigned long timeout);
  235.             */
  236.     
  237.             /* Notification operations */
  238.             void monitor_on(in Client cb, in string pilot_id)
  239.                 raises(UnknownPilot,NoAccess);
  240.             void monitor_off(in Client cb, in string pilot_id)
  241.                 raises(UnknownPilot,NoAccess);
  242.     
  243.             /* if a notify_on is done several times for the same eventtype, 
  244.                callback to all callback objects */
  245.        
  246.             void notify_on(in EventType event, in Client cb)
  247.                 raises(NoMonitors);
  248.             void notify_off(in EventType event, in Client cb)
  249.                 raises(NoMonitors);
  250.         };
  251.  
  252.     };
  253. };
  254.